#!/bin/bash

problems=(
    "56. 合并区间"
    "986. 区间列表的交集"
    "1288. 删除被覆盖区间"
    "435. 无重叠区间"
    "452. 用最少数量的箭引爆气球"
    "1024. 视频拼接"
    "1834. 单线程 CPU"
)

for prob in "${problems[@]}"; do
    num=$(echo $prob | grep -oE '^[0-9]+')
    title=$(echo $prob | sed "s/$num//g" | xargs)
    # 移除标题中的点号
    title=${title//./}
    filename="LC_${num}_${title// /_}.java"
    cat > $filename <<EOF
package org.labuladong.其他经典算法.区间问题;

/**
 * @Author: qingle
 * @Date: 2024/10/28-16:11
 * @Description: $prob
 * @version: 1.0
 */
public class LC_${num}_${title// /_} {
}
EOF
done